<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
     <title>
        	修改管理员密码
	</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.min.css"  />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/font-awesome.min.css"  />
</head>
<script src="${pageContext.request.contextPath}/js/jquery-1.6.3.js"></script>
 <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
 <script src="${pageContext.request.contextPath}/css/unslider.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#submit").click(function(){
		var newPwd=$("#newPwd").val();
		var newPwd2=$("#newPwd2").val();
		if(newPwd!=newPwd2){
			alert("两次输入的密码不一致");
			return false;
		}
		var val=$("#myform").serialize();
		var url="${pageContext.request.contextPath}/AdminUserContorller/update.action";
		$.post(url,val,function(data){
			if(data.result==null){
				alert("原密码不正确或内部错误,请刷新再试");
				return false;
			}else{
				alert("修改成功");
				window.location.href="${pageContext.request.contextPath}/OrderController/listOrder.action?state=0";
			}
		});
		
		return false;
});

});
</script>
<body style="width: 100%;height: 100%">
    	<h3 style="margin-left:30%;color:red">注意:您正准备修改管理员密码,请牢记新密码.</h3>
     		<form action="${pageContext.request.contextPath}/AdminUserController/update.action" method="post" id="myform">
					<label style="margin-left: 48%;margin-top:20px;color: #080808;font-size: 16px">原始密码</label>
					<span style="color: red;margin-left:5px;font-size: 12px" id="unSpan"></span>
					<div class="input-group" style="width: 40%;margin: auto;" >  
					<div class="input-group-addon"><span class="fa fa-unlock"></span></div>
					<input type="password" id="oldPwd" placeholder="请输入原密码*" class="form-control" name="oldPwd">	
					</div>
					<label style="margin-left: 48%;margin-top:20px;color: #080808;font-size: 16px">新密码</label>
					<span style="color: red;margin-left:5px;font-size: 12px" id="unSpan"></span>
					<div class="input-group" style="width: 40%;margin: auto;" >  
					<div class="input-group-addon"><span class="fa fa-unlock-alt"></span></div>
					<input type="password" id="newPwd" placeholder="请输入新密码*" class="form-control" name="password">	
					</div>
					<label style="margin-left: 48%;margin-top:20px;color: #080808;font-size: 16px">重复密码</label>
					<span style="color: red;margin-left:5px;font-size: 12px" id="unSpan"></span>
					<div class="input-group" style="width: 40%;margin: auto;" >  
					<div class="input-group-addon"><span class="fa fa-unlock-alt"></span></div>
					<input type="password" id="newPwd2" placeholder="请重复新密码*" class="form-control" >	
					</div>
								<input type="hidden" value="${admin.id}" name="id">
								<input id="submit" type="submit" value="确认修改" style="letter-spacing:20px;margin:20px 0 0 44%; ;padding-left:24px;" class="btn btn-info">
								
					</form>
 </body>
   <style>
   </style>
</html>